<template>
  <a-card :bordered="false">
    <!-- 查询区域 -->
    <div class="table-page-search-wrapper">
      <a-form layout="inline" @keyup.enter.native="searchQuery">
        <a-row :gutter="24">
          <a-col :xl="6" :lg="7" :md="8" :sm="24">
            <a-form-item    label="任务类型">
              <a-radio-group   v-model="queryParam.bizTaskType" @change="onBizTaskTypeChange">
                <a-radio value="1">待我审批</a-radio>
                <a-radio value="2">我发起的申请</a-radio>
                <a-radio value="3" v-has="'quanbu'" >全部订单</a-radio>
                <a-radio value="4"  >已办理订单</a-radio>
              </a-radio-group>
            </a-form-item>
          </a-col>
          <a-col :xl="6" :lg="7" :md="8" :sm="24">
            <a-form-item   label="订单类型">
              <j-dict-select-tag placeholder="请选择订单类型" v-model="queryParam.dingdanLeixing" dictCode="dingdan_leixing"/>
            </a-form-item>
          </a-col>
          <a-col :xl="6" :lg="7" :md="8" :sm="24">
            <a-form-item label="流程状态">
              <!--                <a-input placeholder="请输入流程状态" v-model="queryParam.bpmStatus" dictCode="bpm_status"></a-input>-->
              <j-dict-select-tag placeholder="请输入流程状态" v-model="queryParam.bpmStatus" dictCode="bpm_status"/>
            </a-form-item>
          </a-col>
          <template v-if="toggleSearchStatus">
<!--            <a-col :xl="6" :lg="7" :md="8" :sm="24">
              <a-form-item label="所属部门">
                <a-input placeholder="请输入所属部门" v-model="queryParam.sysOrgCode"></a-input>
              </a-form-item>
            </a-col>-->
            <a-col :xl="6" :lg="7" :md="8" :sm="24">
              <a-form-item label="订单发起人">
                <a-input placeholder="订单发起人" v-model="queryParam.createBy"></a-input>
              </a-form-item>
            </a-col>
<!--            <a-col :xl="6" :lg="7" :md="8" :sm="24">
              <a-form-item label="订单编号">
                <a-input placeholder="请输入订单编号" v-model="queryParam.dingdanBianhao"></a-input>
              </a-form-item>
            </a-col>-->

<!--            <a-col :xl="6" :lg="7" :md="8" :sm="24">
              <a-form-item label="任务编号">
                <a-input placeholder="请输入任务编号" v-model="queryParam.taskId"></a-input>
              </a-form-item>
            </a-col>-->
            <a-col :xl="6" :lg="7" :md="8" :sm="24">
              <a-form-item label="任务名称">
                <a-input placeholder="请输入任务名称" v-model="queryParam.taskName"></a-input>
              </a-form-item>
            </a-col>
            <a-col :xl="6" :lg="7" :md="8" :sm="24">
              <a-form-item label="接单人员">
                <j-select-user-by-dep placeholder="请选择接单员" v-model="queryParam.dingdanJiedanyuan"/>
              </a-form-item>
            </a-col>
            <a-col :xl="6" :lg="7" :md="8" :sm="24">
              <a-form-item label="客户名称">
                <a-input placeholder="请输入客户名称" v-model="queryParam.dingdanKehu"></a-input>
              </a-form-item>
            </a-col>
            <a-col :xl="6" :lg="7" :md="8" :sm="24">
              <a-form-item label="订单状态">
                <a-input placeholder="请输入订单状态" v-model="queryParam.dingdanZhuangtai"></a-input>
              </a-form-item>
            </a-col>
            <a-col :xl="6" :lg="7" :md="8" :sm="24">
              <a-form-item label="订单材质">
                <j-dict-select-tag placeholder="请选择订单材质" v-model="queryParam.dingdanCaizhi" dictCode="dingdan_caizhi"/>
              </a-form-item>
            </a-col>
            <a-col :xl="10" :lg="11" :md="12" :sm="24">
              <a-form-item label="下单时间">
                <j-date :show-time="true" date-format="YYYY-MM-DD HH:mm:ss" placeholder="请选择开始时间" class="query-group-cust" v-model="queryParam.dingdanXiadanshijian_begin"></j-date>
                <span class="query-group-split-cust"></span>
                <j-date :show-time="true" date-format="YYYY-MM-DD HH:mm:ss" placeholder="请选择结束时间" class="query-group-cust" v-model="queryParam.dingdanXiadanshijian_end"></j-date>
              </a-form-item>
            </a-col>
            <a-col :xl="10" :lg="11" :md="12" :sm="24">
              <a-form-item label="创建日期">
                <j-date :show-time="true" date-format="YYYY-MM-DD HH:mm:ss" placeholder="请选择开始时间" class="query-group-cust" v-model="queryParam.createTime_begin"></j-date>
                <span class="query-group-split-cust"></span>
                <j-date :show-time="true" date-format="YYYY-MM-DD HH:mm:ss" placeholder="请选择结束时间" class="query-group-cust" v-model="queryParam.createTime_end"></j-date>
              </a-form-item>
            </a-col>
          </template>
          <a-col :xl="6" :lg="7" :md="8" :sm="24">
            <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
              <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
              <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
              <a @click="handleToggleSearch" style="margin-left: 8px">
                {{ toggleSearchStatus ? '收起' : '展开' }}
                <a-icon :type="toggleSearchStatus ? 'up' : 'down'"/>
              </a>
            </span>
          </a-col>
        </a-row>
      </a-form>
    </div>
    <!-- 查询区域-END -->


    <!-- 操作按钮区域 -->

    <div class="table-operator">
<!--      <template v-if="queryParam.bizTaskType=='2'">-->
      <a-button @click="handleAdd" type="primary" icon="plus">新增订单</a-button>
<!--      </template>-->
<!--      <a-button type="primary" icon="download" @click="handleExportXls('table_dayin')">导出</a-button>
      <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">
        <a-button type="primary" icon="import">导入</a-button>
      </a-upload>-->
      <!-- 高级查询区域 -->
      <j-super-query :fieldList="superFieldList" ref="superQueryModal" @handleSuperQuery="handleSuperQuery"></j-super-query>
      <a-dropdown v-if="selectedRowKeys.length > 0">
        <a-menu slot="overlay">
          <a-menu-item key="1" @click="batchDel"><a-icon type="delete"/>删除</a-menu-item>
        </a-menu>
        <a-button style="margin-left: 8px"> 批量操作 <a-icon type="down" /></a-button>
      </a-dropdown>
    </div>


    <!-- table区域-begin -->
    <div>
      <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
        <i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择 <a style="font-weight: 600">{{ selectedRowKeys.length }}</a>项
        <a style="margin-left: 24px" @click="onClearSelected">清空</a>
      </div>

      <a-table
        ref="table"
        size="middle"
        :scroll="{x:true}"
        bordered
        rowKey="id"
        :columns="columns"
        :dataSource="dataSource"
        :pagination="ipagination"
        :loading="loading"
        :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
        class="j-table-force-nowrap"
        @change="handleTableChange">

        <template slot="htmlSlot" slot-scope="text">
          <div v-html="text"></div>
        </template>
        <template slot="imgSlot" slot-scope="text">
          <span v-if="!text" style="font-size: 12px;font-style: italic;">无图片</span>
          <img v-else :src="getImgView(text)" height="25px" alt="" style="max-width:80px;font-size: 12px;font-style: italic;"/>
        </template>
        <template slot="fileSlot" slot-scope="text">
          <span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span>
          <a-button
            v-else
            :ghost="true"
            type="primary"
            icon="download"
            size="small"
            @click="downloadFile(text)">
            下载
          </a-button>
        </template>

<!--        <span slot="action" slot-scope="text, record">
          <a @click="handleEdit(record)">编辑</a>

          <a-divider type="vertical" />
          <a-dropdown>
            <a class="ant-dropdown-link">更多 <a-icon type="down" /></a>
            <a-menu slot="overlay">
              <a-menu-item>
                <a @click="handleDetail(record)">详情</a>
              </a-menu-item>
              <a-menu-item v-if="record.bpmStatus === '1'">
                <a @click="startProcess(record)">发起流程</a>
              </a-menu-item>
              <a-menu-item>
                <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
                  <a>删除</a>
                </a-popconfirm>
              </a-menu-item>
            </a-menu>
          </a-dropdown>
        </span>-->
        <span slot="action" slot-scope="text, record">
          <template v-if="record.bpmStatus === '1'">
            <a @click="handleEdit(record)">编辑</a>
            <a-divider type="vertical"/>
            <a @click="startProcess(record)">提交流程</a>
            <a-divider type="vertical"/>
          </template><!--
          <template v-else-if="showBtn(record.bpmStatus)&&queryParam.bizTaskType=='1'">
            <a @click="handleProcess(record)">办理</a>
            <a-divider type="vertical"/>
          </template>-->
<!--           <template v-if="currTask.taskClaimFlag">
            <a @click="handleClaim(record)"  >签收 </a>
              <a-divider type="vertical"/>
          </template>-->
          <template v-if="showBtn(record.bpmStatus)&&queryParam.bizTaskType=='2'">
            <a @click="taskNotify(flowCode,record.id)">催办</a>
            <a-divider type="vertical"/>
          </template>
             <template >
             <a  @click="handleDetail(record)">订单详情</a>
            <a-divider type="vertical"/>
          </template>
            <template >
               <a @click="handlePreviewPic(record)">审批进度</a>
            <a-divider type="vertical"/>
          </template>





          <a-dropdown>
            <a class="ant-dropdown-link">更多 <a-icon type="down" /></a>
            <a-menu slot="overlay">
<!--              <a-menu-item v-if="queryParam.bizTaskType=='2'">
                <a href="javascript:;" @click="handleDetail(record)">详情</a>
              </a-menu-item>-->
               <a-menu-item  v-if="showBtn(record.bpmStatus)&&queryParam.bizTaskType=='2'">
                 <a-popconfirm title="确定要作废吗?" @confirm="() => invalidProcess(record)">
                    <a>
                      作废流程
                    </a>
                  </a-popconfirm>
              </a-menu-item>
              <a-menu-item v-if="record.bpmStatus === '1'">
                <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
                  <a>删除</a>
                </a-popconfirm>
              </a-menu-item>

              <!--<a-menu-item v-else @click="handlePreviewPic(record)">审批进度</a-menu-item>-->
              <a-menu-item v-else @click="handleTrack(record)">详细进度</a-menu-item>
<!--        谁都可以催办     <a-menu-item @click="taskNotify(flowCode,record.id)">催办</a-menu-item>-->
<!--         申请人可以催办     <a-menu-item v-if="queryParam.bizTaskType =='2'" @click="taskNotify(flowCode,record.id)">催办</a-menu-item>-->
            </a-menu>
          </a-dropdown>
        </span>
        <span slot="notify" slot-scope="text, record">
          <a-icon title="催办提醒" v-if="record.taskUrge" theme="twoTone" twoToneColor="#eb2f96"  @click="taskNotifyMe(flowCode,record.id)" type="notification"/>
          {{ text }}
        </span>
      </a-table>
    </div>

    <table-dayin-copy-modal ref="modalForm" @ok="modalFormOk"></table-dayin-copy-modal>
    <bpm-process-track-modal ref="bpmProcessTrackModal"></bpm-process-track-modal>
    <bpm-biz-task-deal-modal ref="taskDealModal" :path="path" :formData="formData" @ok="handleOk"></bpm-biz-task-deal-modal>
    <biz-task-notify-modal ref="taskNotifyModal"></biz-task-notify-modal>
    <ext-act-process-inst-pic-modal ref="extActProcessInstPicModal"></ext-act-process-inst-pic-modal>


  </a-card>
</template>

<script>
  import '@/assets/less/TableExpand.less'
  import { mixinDevice } from '@/utils/mixin'
  import TableDayinCopyModal from './modules/TableDayinCopyModal'
  import { getAction, postAction, putAction } from '@/api/manage'
  import {filterMultiDictText} from '@/components/dict/JDictSelectUtil'
  import {JeecgBpmListMixin} from '@/mixins/JeecgBpmListMixin'
  import {initDictOptions, filterDictText} from '@/components/dict/JDictSelectUtil'
  import BpmBizTaskDealModal from "@/views/modules/bpmbiz/common/BpmBizTaskDealModal.vue";
  import BpmProcessTrackModal from "@/views/modules//bpmbiz/common/BpmProcessTrackModal.vue";
  import BizTaskNotifyModal from "@/views/modules/bpmbiz/common/BizTaskNotifyModal.vue";
  import BizTaskNotifyMeModal from "@/views/modules/bpmbiz/common/BizTaskNotifyMeModal.vue";
  import BpmBizBatchRestartDealModal from '@views/modules/bpmbiz/common/BpmBizBatchRestartDealModal.vue'
  import BpmBizBatchRejectDealModal from '@views/modules/bpmbiz/common/BpmBizBatchRejectDealModal.vue'
  import ExtBizLeaveModal from '@views/modules/extbpm/biz/modules/ExtBizLeaveModal.vue'
  import BpmBizBatchCompleteDealModal from '@views/modules/bpmbiz/common/BpmBizBatchCompleteDealModal.vue'
  import BpmBizBatchSuspendDealModal from '@views/modules/bpmbiz/common/BpmBizBatchSuspendDealModal.vue'
  import BpmBizBatchEntrusterDealModal from '@views/modules/bpmbiz/common/BpmBizBatchEntrusterDealModal.vue'
  import ExtActProcessInstPicModal from '@views/modules/extbpm/process/modules/ExtActProcessInstPicModal.vue'
  export default {
    name: 'TableDayinCopyList',
    mixins:[JeecgBpmListMixin, mixinDevice],
    components: {
      ExtActProcessInstPicModal,
      BpmBizBatchEntrusterDealModal,
      BpmBizBatchSuspendDealModal,
      BpmBizBatchCompleteDealModal,
      ExtBizLeaveModal,
      BpmBizBatchRejectDealModal,
      BpmBizBatchRestartDealModal,
      TableDayinCopyModal,
      BpmProcessTrackModal,
      BpmBizTaskDealModal,
      BizTaskNotifyModal,
      BizTaskNotifyMeModal,
    },
    data () {
      return {
        description: 'table_dayin管理页面',
        // 表头
        columns: [
          {
            title: '#',
            dataIndex: '',
            key: 'rowIndex',
            width: 60,
            align: 'center',
            customRender: function(t, r, index) {
              return parseInt(index) + 1
            }
          },
          /* {
             title:'所属部门',
             align:"center",
             dataIndex: 'sysOrgCode'
           },*/
          {
            title: '流程状态',
            align: 'center',
            dataIndex: 'bpmStatus',
            customRender: (text, record, index) => {
              //字典值替换通用方法
              return filterDictText(this.bpmStatusDictOptions, text)

            }

          },
          {
            title: '订单编号',
            align: 'center',
            dataIndex: 'dingdanBianhao'
          },
          {
            title: '订单类型',
            align: 'center',
            dataIndex: 'dingdanLeixing_dictText'
          },
          {
            title: '任务名称',
            align: 'center',
            dataIndex: 'taskName'
          },
          {
            title: '接单人员',
            align: 'center',
            dataIndex: 'dingdanJiedanyuan_dictText',
            scopedSlots: { customRender: 'notify' }
          },
          {
            title: '客户名称',
            align: 'center',
            dataIndex: 'dingdanKehu'
          },
          {
            title: '客户联系方式',
            align: 'center',
            dataIndex: 'kehuDianhua'
          },
         /* {
            title: '订单要求',
            align: 'center',
            dataIndex: 'dingdanYaoqiu',
            scopedSlots: { customRender: 'htmlSlot' }
          },*/
          {
            title: '模型图片',
            align: 'center',
            dataIndex: 'dingdanTupian',
            scopedSlots: { customRender: 'imgSlot' }
          },
          {
            title: '订单状态',
            align: 'center',
            dataIndex: 'dingdanZhuangtai',
            customRender: (text, record, index) => {
              //字典值替换通用方法
              return  filterDictText(this.bpmStatusDictOptions, text)


            }
          },
          {
            title: '下单时间',
            align: 'center',
            dataIndex: 'dingdanXiadanshijian'
          },
        /*  {
            title: '模型重克',
            align: 'center',
            dataIndex: 'dingdanMoxingzhongliang'
          },*/
          {
            title: '模型件数',
            align: 'center',
            dataIndex: 'dingdanShuliang'
          },
          {
            title: '货款状态',
            align: 'center',
            dataIndex: 'dingdanHuokuan_dictText'
          },
          {
            title: '发货方式',
            align: 'center',
            dataIndex: 'dingdanFahuofangshi_dictText'
          },
          // {
          //   title:'设计人员',
          //   align:"center",
          //   dataIndex: 'shejiRenyuan_dictText'
          // },
          // {
          //   title:'设计要求时间',
          //   align:"center",
          //   dataIndex: 'shejiRenyuanYaoqiuDate'
          // },
          // {
          //   title:'设计完成时间',
          //   align:"center",
          //   dataIndex: 'shejiRenyuanWanchengDate'
          // },
          // {
          //   title:'设计评分',
          //   align:"center",
          //   dataIndex: 'shejiRenyuanPingfen_dictText'
          // },
          // {
          //   title:'编程人员',
          //   align:"center",
          //   dataIndex: 'bianchengRenyuan_dictText'
          // },
          // {
          //   title:'编程要求时间',
          //   align:"center",
          //   dataIndex: 'bianchengRenyuanYaoqiuDate'
          // },
          // {
          //   title:'编程完成时间',
          //   align:"center",
          //   dataIndex: 'bianchengRenyuanWanchengDate'
          // },
          // {
          //   title:'编程评分',
          //   align:"center",
          //   dataIndex: 'bianchengRenyuanPingfen_dictText'
          // },
          // {
          //   title:'上机人员',
          //   align:"center",
          //   dataIndex: 'shangjiRenyuan_dictText'
          // },
          // {
          //   title:'上机要求时间',
          //   align:"center",
          //   dataIndex: 'shangjiRenyuanYaoqiuDate'
          // },
          // {
          //   title:'上机完成时间',
          //   align:"center",
          //   dataIndex: 'shangjiRenyuanWanchengDate'
          // },
          // {
          //   title:'上机评分',
          //   align:"center",
          //   dataIndex: 'shangjiRenyuanPingfen_dictText'
          // },
          // {
          //   title:'清洗人员',
          //   align:"center",
          //   dataIndex: 'qingxiRenyuan_dictText'
          // },
          // {
          //   title:'清洗完成时间',
          //   align:"center",
          //   dataIndex: 'qingxiRenyuanWanchengDate'
          // },
          // {
          //   title:'清洗要求时间',
          //   align:"center",
          //   dataIndex: 'qingxiRenyuanYaoqiuDate'
          // },
          // {
          //   title:'清洗评分',
          //   align:"center",
          //   dataIndex: 'qingxiRenyuanPingfen_dictText'
          // },
          // {
          //   title:'打磨人员',
          //   align:"center",
          //   dataIndex: 'damoRenyuan_dictText'
          // },
          // {
          //   title:'打磨要求时间',
          //   align:"center",
          //   dataIndex: 'damoRenyuanYaoqiuDate'
          // },
          // {
          //   title:'打磨完成时间',
          //   align:"center",
          //   dataIndex: 'damoRenyuanWanchengDate'
          // },
          // {
          //   title:'打磨评分',
          //   align:"center",
          //   dataIndex: 'damoRenyuanPingfen_dictText'
          // },
          // {
          //   title:'上色人员',
          //   align:"center",
          //   dataIndex: 'shangseRenyuan_dictText'
          // },
          // {
          //   hidden: true,
          //   title:'上色要求时间',
          //   align:"center",
          //   dataIndex: 'shangseRenyuanYaoqiuDate'
          // },
          // {
          //   hidden: true,
          //   title:'上色完成时间',
          //   align:"center",
          //   dataIndex: 'shangseRenyuanWanchengDate'
          // },
          // {
          //   hidden: true,
          //   title:'上色评分',
          //   align:"center",
          //   dataIndex: 'shangseRenyuanPingfen_dictText'
          // },
          // {
          //   hidden: true,
          //   title:'装配人员',
          //   align:"center",
          //   dataIndex: 'zhuangpeiRenyuan_dictText'
          // },
          // {
          //   hidden: true,
          //   title:'装配要求时间',
          //   align:"center",
          //   dataIndex: 'zhuangpeiRenyuanYaoqiuDate'
          // },
          // {
          //   hidden: true,
          //   title:'装配完成时间',
          //   align:"center",
          //   dataIndex: 'zhuangpeiRenyuanWanchengDate'
          // },
          // {
          //   hidden: true,
          //   title:'装配评分',
          //   align:"center",
          //   dataIndex: 'zhuangpeiRenyuanPingfen_dictText'
          // },
          // {
          //   hidden: true,
          //   title:'质检人员',
          //   align:"center",
          //   dataIndex: 'zhijianRenyuan_dictText'
          // },
          // {
          //   hidden: true,
          //   title:'质检要求时间',
          //   align:"center",
          //   dataIndex: 'zhijianRenyuanYaoqiuDate'
          // },
          // {
          //   hidden: true,
          //   title:'质检完成时间',
          //   align:"center",
          //   dataIndex: 'zhijianRenyuanWanchengDate'
          // },
          // {
          //   hidden: true,
          //   title:'质检评分',
          //   align:"center",
          //   dataIndex: 'zhijianRenyuanPingfen_dictText'
          // },
          // {
          //   hidden: true,
          //   title:'发货人员',
          //   align:"center",
          //   dataIndex: 'fahuoRenyuan_dictText'
          // },
          // {
          //   hidden: true,
          //   title:'发货要求时间',
          //   align:"center",
          //   dataIndex: 'fahuoRenyuanYaoqiuDate'
          // },
          // {
          //   hidden: true,
          //   title:'发货完成时间',
          //   align:"center",
          //   dataIndex: 'fahuoRenyuanWanchengDate'
          // },
          // {
          //   hidden: true,
          //   title:'发货评分',
          //   align:"center",
          //   dataIndex: 'fahuoRenyuanPingfen_dictText'
          // },
          // {
          //   hidden: true,
          //   title:'单克金额报价',
          //   align:"center",
          //   dataIndex: 'dankeJine'
          // },
          // {
          //   hidden: true,
          //   title:'订单预估金额',
          //   align:"center",
          //   dataIndex: 'dingdanYuguJine'
          // },
          // {
          //   hidden: true,
          //   title:'订单实际金额',
          //   align:"center",
          //   dataIndex: 'dingdanShijiJine'
          // },
          // {
          //   hidden: true,
          //   title:'订单材质',
          //   align:"center",
          //   dataIndex: 'dingdanCaizhi_dictText'
          // },
          // {
          //   hidden: true,
          //   title:'设计拆件数量',
          //   align:"center",
          //   dataIndex: 'shejiCaijianShuliang'
          // },
          // {
          //   hidden: true,
          //   title:'下机拆件数量',
          //   align:"center",
          //   dataIndex: 'xiajiCaijianShuliang'
          // },
          // {
          //   hidden: true,
          //   title:'清洗拆件数量',
          //   align:"center",
          //   dataIndex: 'qingxiCaijianShuliang'
          // },
          // {
          //   title:'打磨拆件数量',
          //   align:"center",
          //   dataIndex: 'damoCaijianShuliang',
          //   hidden: true,
          // },
          // {
          //   title:'上色拆件数量',
          //   align:"center",
          //   dataIndex: 'shangseCaijianShuliang',
          //   hidden: true,
          // },
          // {
          //   title:'组装拆件数量',
          //   align:"center",
          //   dataIndex: 'zuzhuangCaijianShuliang',
          //   hidden: true,
          // },
          {
            title: '操作',
            dataIndex: 'action',
            align: 'center',
            fixed: 'right',
            width: 147,
            scopedSlots: { customRender: 'action' },
            bpmStatusDictOptions: []
          }
        ],
        url: {
          list: '/dayincopy/tableDayinCopy/list',
          delete: '/dayincopy/tableDayinCopy/delete',
          deleteBatch: '/dayincopy/tableDayinCopy/deleteBatch',
          exportXlsUrl: '/dayincopy/tableDayinCopy/exportXls',
          importExcelUrl: 'dayincopy/tableDayinCopy/importExcel',
          startProcess: '/act/process/extActProcess/startMutilProcess'
        },
        //代码生成后需手动设置流程编码
        flowCode: 'table_dayin_copy_0925',
        formUrl: 'dayinwork/modules/TableDayinCopyForm',
        formUrlMobile: 'dayinwork/modules/TableDayinCopyForm',
        dictOptions: {},
        superFieldList: []
      }
    },
    created() {
    this.getSuperFieldList();
    },
    computed: {
      importExcelUrl: function(){
        return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
      },
    },
    methods:{
      handlePreviewPic: function(record){
        var flowCode = this.flowCode;
        var dataId = record.id;
        this.$refs.extActProcessInstPicModal.preview(flowCode,dataId);
        this.$refs.extActProcessInstPicModal.title="流程图";
      },
    initDictConfig(){
        //初始化字典
        initDictOptions('bpm_status').then((res) => {
          if (res.success) {
            this.bpmStatusDictOptions = res.result;
          }
        });

      },
      async loadData(arg) {
        if(!this.url.list){
          this.$message.error("请设置url.list属性!")
          return
        }
        //加载数据 若传入参数1则加载第一页的内容
        if (arg === 1) {
          this.ipagination.current = 1;
        }
        var params = this.getQueryParams();//查询条件
        this.loading = true;
        let res =  await getAction(this.url.list, params)
        this.loading = false;
        if (res.success) {
          this.dataSource =res.result.records;
          this.ipagination.total = res.result.total;
          const data = [...this.dataSource];
          if(this.queryParam.bizTaskType=='1'){
            for (var i=0;i<data.length;i++){
              //item.taskUrge = false;
              var item = data[i];
              var params = {flowCode:this.flowCode,dataId:item.id};//查询条件
              let res2 = await getAction(this.url.checkNotify,params);
              if(res2.result){
                item.taskUrge = true;
              }
            }
          }
          this.dataSource = data;
        }
      },
      startProcess(record){
        this.$confirm({
          title:'提示',
          content:'确认提交流程吗?',
          onOk:()=>{
            let params = {
              flowCode: this.flowCode,
              id: record.id,
              formUrl: 'dayincopy/modules/TableDayinCopyForm',
              formUrlMobile: ''
            }
            postAction(this.url.startProcess, params).then(res=>{
              if(res.success){
                this.$message.success(res.message);
                this.loadData();
                this.onClearSelected();
              }else{
                this.$message.warning(res.message);
              }
            }).catch((e)=>{
              this.$message.warning('不识别的请求!');
            })
          }
        })
      },

      getSuperFieldList(){
        let fieldList=[];
        fieldList.push({type:'string',value:'createBy',text:'创建人',dictCode:''})
        fieldList.push({type:'datetime',value:'createTime',text:'创建日期'})
        fieldList.push({type:'string',value:'sysOrgCode',text:'所属部门',dictCode:''})
        fieldList.push({type:'string',value:'bpmStatus',text:'流程状态',dictCode:'bpm_status'})
        fieldList.push({type:'string',value:'dingdanBianhao',text:'订单编号',dictCode:''})
        fieldList.push({type:'string',value:'dingdanLeixing',text:'订单类型',dictCode:'dingdan_leixing'})
        fieldList.push({type:'string',value:'taskId',text:'任务编号',dictCode:''})
        fieldList.push({type:'string',value:'taskName',text:'任务名称',dictCode:''})
        fieldList.push({type:'sel_user',value:'dingdanJiedanyuan',text:'接单员'})
        fieldList.push({type:'string',value:'dingdanKehu',text:'客户名称',dictCode:''})
        fieldList.push({type:'string',value:'kehuDianhua',text:'客户联系方式',dictCode:''})
        fieldList.push({type:'Text',value:'dingdanYaoqiu',text:'订单要求',dictCode:''})
        fieldList.push({type:'string',value:'dingdanTupian',text:'模型图片',dictCode:''})
        fieldList.push({type:'string',value:'dingdanZhuangtai',text:'订单状态',dictCode:''})
        fieldList.push({type:'datetime',value:'dingdanXiadanshijian',text:'下单时间'})
        fieldList.push({type:'string',value:'dingdanMoxingzhongliang',text:'模型重克',dictCode:''})
        fieldList.push({type:'int',value:'dingdanShuliang',text:'模型件数',dictCode:''})
        fieldList.push({type:'string',value:'dingdanHuokuan',text:'货款状态',dictCode:'daikuan_status'})
        fieldList.push({type:'string',value:'dingdanFahuofangshi',text:'发货方式',dictCode:'fahuo_status'})
        fieldList.push({type:'sel_user',value:'shejiRenyuan',text:'设计人员'})
        fieldList.push({type:'datetime',value:'shejiRenyuanYaoqiuDate',text:'设计要求时间'})
        fieldList.push({type:'datetime',value:'shejiRenyuanWanchengDate',text:'设计完成时间'})
        fieldList.push({type:'string',value:'shejiRenyuanPingfen',text:'设计评分',dictCode:'pingfen'})
        fieldList.push({type:'sel_user',value:'bianchengRenyuan',text:'编程人员'})
        fieldList.push({type:'datetime',value:'bianchengRenyuanYaoqiuDate',text:'编程要求时间'})
        fieldList.push({type:'datetime',value:'bianchengRenyuanWanchengDate',text:'编程完成时间'})
        fieldList.push({type:'string',value:'bianchengRenyuanPingfen',text:'编程评分',dictCode:'pingfen'})
        fieldList.push({type:'sel_user',value:'shangjiRenyuan',text:'上机人员'})
        fieldList.push({type:'datetime',value:'shangjiRenyuanYaoqiuDate',text:'上机要求时间'})
        fieldList.push({type:'datetime',value:'shangjiRenyuanWanchengDate',text:'上机完成时间'})
        fieldList.push({type:'string',value:'shangjiRenyuanPingfen',text:'上机评分',dictCode:'pingfen'})
        fieldList.push({type:'sel_user',value:'qingxiRenyuan',text:'清洗人员'})
        fieldList.push({type:'datetime',value:'qingxiRenyuanWanchengDate',text:'清洗完成时间'})
        fieldList.push({type:'datetime',value:'qingxiRenyuanYaoqiuDate',text:'清洗要求时间'})
        fieldList.push({type:'string',value:'qingxiRenyuanPingfen',text:'清洗评分',dictCode:'pingfen'})
        fieldList.push({type:'sel_user',value:'damoRenyuan',text:'打磨人员'})
        fieldList.push({type:'datetime',value:'damoRenyuanYaoqiuDate',text:'打磨要求时间'})
        fieldList.push({type:'datetime',value:'damoRenyuanWanchengDate',text:'打磨完成时间'})
        fieldList.push({type:'string',value:'damoRenyuanPingfen',text:'打磨评分',dictCode:'pingfen'})
        fieldList.push({type:'sel_user',value:'shangseRenyuan',text:'上色人员'})
        fieldList.push({type:'datetime',value:'shangseRenyuanYaoqiuDate',text:'上色要求时间'})
        fieldList.push({type:'datetime',value:'shangseRenyuanWanchengDate',text:'上色完成时间'})
        fieldList.push({type:'string',value:'shangseRenyuanPingfen',text:'上色评分',dictCode:'pingfen'})
        fieldList.push({type:'sel_user',value:'zhuangpeiRenyuan',text:'装配人员'})
        fieldList.push({type:'datetime',value:'zhuangpeiRenyuanYaoqiuDate',text:'装配要求时间'})
        fieldList.push({type:'datetime',value:'zhuangpeiRenyuanWanchengDate',text:'装配完成时间'})
        fieldList.push({type:'string',value:'zhuangpeiRenyuanPingfen',text:'装配评分',dictCode:'pingfen'})
        fieldList.push({type:'sel_user',value:'zhijianRenyuan',text:'质检人员'})
        fieldList.push({type:'datetime',value:'zhijianRenyuanYaoqiuDate',text:'质检要求时间'})
        fieldList.push({type:'datetime',value:'zhijianRenyuanWanchengDate',text:'质检完成时间'})
        fieldList.push({type:'string',value:'zhijianRenyuanPingfen',text:'质检评分',dictCode:'pingfen'})
        fieldList.push({type:'sel_user',value:'fahuoRenyuan',text:'发货人员'})
        fieldList.push({type:'datetime',value:'fahuoRenyuanYaoqiuDate',text:'发货要求时间'})
        fieldList.push({type:'datetime',value:'fahuoRenyuanWanchengDate',text:'发货完成时间'})
        fieldList.push({type:'string',value:'fahuoRenyuanPingfen',text:'发货评分',dictCode:'pingfen'})
        fieldList.push({type:'string',value:'dankeJine',text:'单克金额报价',dictCode:''})
        fieldList.push({type:'BigDecimal',value:'dingdanYuguJine',text:'订单预估金额',dictCode:''})
        fieldList.push({type:'BigDecimal',value:'dingdanShijiJine',text:'订单实际金额',dictCode:''})
        fieldList.push({type:'string',value:'dingdanCaizhi',text:'订单材质',dictCode:'dingdan_caizhi'})
        fieldList.push({type:'string',value:'shejiCaijianShuliang',text:'设计拆件数量',dictCode:''})
        fieldList.push({type:'string',value:'xiajiCaijianShuliang',text:'下机拆件数量',dictCode:''})
        fieldList.push({type:'string',value:'qingxiCaijianShuliang',text:'清洗拆件数量',dictCode:''})
        fieldList.push({type:'string',value:'damoCaijianShuliang',text:'打磨拆件数量',dictCode:''})
        fieldList.push({type:'string',value:'shangseCaijianShuliang',text:'上色拆件数量',dictCode:''})
        fieldList.push({type:'string',value:'zuzhuangCaijianShuliang',text:'组装拆件数量',dictCode:''})
        this.superFieldList = fieldList
      }
    }
  }
</script>
<style scoped>
  @import '~@assets/less/common.less';
</style>